#include "rapidjson/document.h"
#include "rapidjson/writer.h"
#include "rapidjson/stringbuffer.h"

#include <iostream>
#include <string>

std::string getImagePath(std::string jsonString) {
    rapidjson::Document doc;
    doc.Parse(jsonString.data());

    const rapidjson::Value& arr = doc["images"];
    for (unsigned int i = 0; i < arr.Size(); ++i) {
        const rapidjson::Value& obj = arr[i];
        const rapidjson::Value& target = obj["url"];

        std::string url = target.GetString();

        return url;
    }

    std::cout << "无法获取到图片URL" << std::endl;
    exit(-1);
}